package com.itheima.controller;

import com.itheima.pojo.Result;
import com.itheima.pojo.Student;
import com.itheima.service.StuServiceInter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class StuController {
    @Autowired
    private StuServiceInter stuServiceInter;
    @RequestMapping("/listStu")
    public Result listStudent(){
        List<Student> studentList = stuServiceInter.listStudent();
        return Result.success(studentList);
    }

}
